<template>
    <div style="height:4000px">
        <div class="heading">
            <div class="heading-img">
                <img :src="author.author_img">
            </div>
            <div class="heading-name">{{author.name}}</div>
            <div class="heading-js">{{author.work_num}} &nbsp;·&nbsp; 故事</div>
        </div>
        <div class="container"> <span> Ta 的 故 事</span></div>
       
        <div class="my">
            <div  class="item-center" v-for="(info,index) in infos" :key="index">
                
                <p>
                    <span><img :src="info.author_img"></span>
                    <span>{{info.name}}</span>
                    <span>{{info.s_date}}</span>
                </p>
                <router-link :to="{name:'storyDetail',params:{id:info.story_id}}">
                <p class="title">{{info.title}}</p>
                <div class="text" v-html="info.s_content">{{info.s_content}}</div>
                </router-link>
            </div> 
        </div>
    </div>
</template>

<script>

export default {
    name:"author",
   data () {
      return {
        author: [],
        infos:[],
        id:'',
        
      }
    },
    methods:{


    },
    mounted(){

        this.id = this.$route.params.id;
         this.$axios.get('/getAByid.do?author_id='+this.id).then(response=>{
            this.author = response.data ;
         console.log(this.author+"列表");
       })

        this.$axios.get('/getAuthorByid.do?author_id='+this.id).then(response=>{
            this.infos = response.data ;
         console.log(this.infos+"列表");
        //  console.log(response.data+"用户ID");
       }).catch(function(error){
             console.log(error);
         })
        
    },


};
</script>

<style scoped="scoped">
a{
  text-decoration: none;
}
.heading{
    width: 100%;
    padding: 0;
    margin: 0;
    background-color: #21262c;
    height: 340px;
}
.heading-img img{
    width: 150px;
    border-radius: 50%;
}
.heading-img{
   padding-top:60px;
}
.heading-name{
    font-size: 25px;
    color: #fff;
    padding-top: 10px;
}
.heading-js{
    font-size: 20px;
    color: #9ea0a0;
    margin-bottom: 15px;

}



.container{
    margin-top: 20px;
    margin-bottom: 20px;
    width: 100%;
    text-align: center;
    font-size: 30px;
    border-bottom: 2px solid #ccc;
}
.container>span{
    color: #222324;
    border-bottom: 3px solid rgb(218, 94, 94);
    padding-bottom: 6px;
}
.my{
   width: 100%;
   padding-left:10% ;
   padding-right:10% ;
   height:1000px ;
}
.item-center{
    margin-top: 20px;
    width: 100%;
    background-color: #f8f7f5;
    padding: 50px;
}
.item-center>p:nth-child(2){
    font-size: 30px;
    font-weight: 700;
    text-align: left;
    color: rgb(193, 180, 139);
    letter-spacing: 11px;
    margin-bottom: 30px;
    margin-top: 50px;
}
.item-center>p:nth-child(1){
    text-align-last: left;
    font-size: 15px;
    font-weight: 700;
    display: flex;
}
.item-center>p:nth-child(1) img{
    width: 50px;
    border-radius: 50%;

}
.item-center>p:nth-child(1)>span:nth-child(1){
    width: 7%;
}
.item-center>p:nth-child(1)>span:nth-child(2){
    width: 90%;
    font-size: 20px;
    padding-top: 12px;
    margin-left: 20px;
}
.item-center>p:nth-child(1)>span:nth-child(3){
    width: 15%;
    
}
.text{
    font-size: 20px;
    letter-spacing: 1px;
    line-height: 50px;
    word-break:break-word;
    text-align-last: left;
     display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-line-clamp: 3;
    color: #21262c;
    text-indent: 2em;
}

.title{
    font-size: 30px;
    color: #21262c;
}
</style>